package com.songlanyun.modules.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.drive.IBaseService;
import com.songlanyun.modules.inter.ISaleEntity;
import com.songlanyun.modules.memberbill.entity.GiveBalanceDTO;
import com.songlanyun.modules.order.entity.Order;
import com.songlanyun.modules.order.model.dto.SubmitChildOrderDTO;
import com.songlanyun.modules.order.model.dto.SubmitOrderDTO;
import com.songlanyun.modules.order.model.dto.SubmitShopOrderDTO;
import com.songlanyun.modules.order.model.vo.SubmitChildOrderVo;
import com.songlanyun.modules.order.model.vo.SubmitOrderReceiptVo;
import com.songlanyun.modules.order.model.vo.SubmitOrderVo;
import com.songlanyun.modules.order.model.vo.SubmitShopOrderVo;
import com.songlanyun.modules.payorder.entity.PayOrder;

import java.math.BigDecimal;
import java.util.List;

/**
 * 销售系统中的主订单
 *
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-16 14:14:42
 */
public interface CreateOrderService  extends IService<Order> {

    SubmitOrderVo buildSubmitOrder(Long userId, SubmitOrderDTO dto);

    PayOrder createPayOrder(Long userId, SubmitOrderDTO dto);

    void thirdCanSaleCheck(SubmitOrderVo vo);

    Order createOrder(Long userId, PayOrder payOrder, SubmitOrderVo submitOrderVo, SubmitShopOrderVo vo);

    void createOrderKey(Order order);

    void createOrderReceiving(Order order, SubmitOrderVo vo);

    SubmitOrderVo initSubmitOrderVo(Long userId, SubmitOrderDTO dto);

    BigDecimal processFreight(Long shopId, SubmitOrderReceiptVo receipt, List<SubmitChildOrderVo> childOrderVoList);

    SubmitShopOrderVo initBuildSubmitShopOrderVo(Long userId, SubmitOrderDTO dto, SubmitShopOrderDTO o);

    SubmitChildOrderVo initBuildSubmitChildOrderVo(ISaleEntity saleEntity, SubmitOrderDTO dto, SubmitShopOrderDTO o, SubmitChildOrderDTO s);

    void computeSelectedShopCoupon(Long userId, SubmitShopOrderVo vo, SubmitShopOrderDTO o);

    void backStageManagement(GiveBalanceDTO dto);

}

